package com.hhs.storage.controller;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.hhs.storage.bean.GKf;
import com.hhs.storage.bean.GTname;
import com.hhs.storage.bean.InputParam;
import com.hhs.storage.bean.Result;
import com.hhs.storage.service.GKfService;
import com.hhs.storage.service.GTnameService;
import com.hhs.storage.util.FileUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author shadow
 * @since 2020-06-17
 */
@RestController
@RequestMapping("/do/kf")
@Slf4j
public class GKfController {
    @Resource
    GKfService gKfService;

    @RequestMapping(value = "getdata")
    public Map<String, Object> getdata() {
        log.info("查询客服信息");
        EntityWrapper ew = new EntityWrapper<GKf>();
        ew.eq("id_",1);
        List result = gKfService.selectList(ew);
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("rows", result);
        map.put("total",1);
        return map;
    }
    @RequestMapping(value = "edit")
    public Map<String, Object> saveOrUpdate(GKf gKf){
        log.info("编辑客服信息");
        gKfService.updateById(gKf);
        return Result.sucJsonResp(null);
    }



}

